package com.wordlearning.third.audio;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 文本转语音选项类
 * 封装TTS合成的各种参数配置
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TtsOptions {
    
    // 默认语音
    public static final String DEFAULT_VOICE = "expr-voice-5-m";
    // 默认语速
    public static final double DEFAULT_SPEED = 1.0;
    // 默认语言
    public static final String DEFAULT_LANGUAGE = "en-us";
    
    // 语音模型标识
    private String voice = DEFAULT_VOICE;
    
    // 语速，大于0的浮点数
    private double speed = DEFAULT_SPEED;
    
    // 语言代码
    private String language = DEFAULT_LANGUAGE;
    
    // 音频格式，默认wav
    private String format = "wav";
    
    /**
     * 创建默认选项实例
     * @return 默认选项
     */
    public static TtsOptions defaultOptions() {
        return TtsOptions.builder()
                .voice(DEFAULT_VOICE)
                .speed(DEFAULT_SPEED)
                .language(DEFAULT_LANGUAGE)
                .format("wav")
                .build();
    }
}